package jtmcraft.game.units;

import java.awt.Color;
import jtmcraft.game.Controller;
import jtmcraft.game.units.states.AttackState;
import jtmcraft.game.units.states.MoveState;


/**
 *
 * @author milosz
 */
public class WarriorUnit extends GameUnit  {

    public static final int DURABILITY = 50;
    public static final int MAX_DESCRUTION = 10;

    public WarriorUnit(Controller actionHandler, Color playerColor )
    {
        super(actionHandler);
        this.setMaxDescrution( MAX_DESCRUTION );
        this.setDurability( DURABILITY );
        this.setMaxDurability( DURABILITY );
        this.setPlayerColor(playerColor);
    }

    @Override
    public void pointEnemy(GameUnit gameUnit) {
        this.getSprite().setMove(true);
        this.setState( new AttackState( gameUnit ) );
    }

    @Override
    public void point(int x, int y) {
        this.getSprite().setMove(true);
        this.setState( new MoveState( x, y ) ); 
    }

    @Override
    public void pointNeutral(GameUnit gameUnit) {
        this.getSprite().setMove(true);
        this.setState( new MoveState( gameUnit) );
    }

}